package cn.tedu.my_shop.controller;

import cn.tedu.my_shop.mapper.ProductMapper;
import cn.tedu.my_shop.mapper.StokeMapper;
import cn.tedu.my_shop.pojo.dto.StokeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stoke")
public class StokeController {
    @Autowired
    private StokeMapper stokeMapper;
    @Autowired
    private ProductMapper productMapper;

    @PostMapping("/insert")
    public void insertStoke(@RequestBody StokeDTO stokeDTO) {
        int titleId = productMapper.selectTitleIdByTitleName(stokeDTO.getProductTitle());
        int brandId = productMapper.selectBrandIdByBrandName(stokeDTO.getProductBrand());
        int typeId = productMapper.selectTypeIdByTypeName(stokeDTO.getProductType());
    }
}
